<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/26
  Time: 13:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<form id="form_train_cancel" class="panel-body form-horizontal form-padding">
  <input type="hidden" name="keyId" id="keyId" value="${keyId}"/>
  <div class="form-group">
    <label class="col-md-2 control-label">取消原因<i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-6">
      <%--<div class="input-group col-md-6">--%>
      <input type="text" class="form-control" id="cancelReason" name="cancelReason" placeholder="请填写取消原因" >
      <%--</div>--%>
    </div>
  </div>
</form>

<script>

  function fn_train_cancel_save(callback) {
    var tmp = $("input#cancelReason").val();
    if(!tmp){
      __toastr_error("请填写取消原因！");
      return false;
    }
    __form_save('form_train_cancel', '<%=path%>/com/train/saveCancel/'+$("#keyId").val(),
            function(data){
              if(data.state == 1){
                callback(data.data);
              } else {
                callback();
              }
            }, function () {
              callback();
            });
  }

</script>